package com.ruoyi.questionnaire.mapper;

import java.util.List;

import com.ruoyi.questionnaire.domain.QuestionnaireAnswer;
import com.ruoyi.questionnaire.domain.QuestionnaireAnswerVO;
 
public interface QuestionnaireAnswerMapper {
    QuestionnaireAnswer selectQuestionnaireAnswerById(Long id);
    List<QuestionnaireAnswer> selectQuestionnaireAnswerList(QuestionnaireAnswer answer);
    int insertQuestionnaireAnswer(QuestionnaireAnswer answer);
    int updateQuestionnaireAnswer(QuestionnaireAnswer answer);
    int deleteQuestionnaireAnswerById(Long id);
    int deleteQuestionnaireAnswerByIds(Long[] ids);
    
    // 统计相关方法
    int countByQuestionnaireId(Long questionnaireId);
    /**
     * 统计指定用户提交的答卷数量
     * @param userId 用户ID
     * @return 答卷数量
     */
    int countByUserId(Long userId);
    
    // 查询答卷列表（包含问卷标题和用户信息）
    List<QuestionnaireAnswerVO> selectQuestionnaireAnswerVOList(QuestionnaireAnswer answer);
} 